package com.armani.service.impl;

import com.armani.entity.ItemSku;
import com.armani.mapper.SkuMapper;
import com.armani.service.SkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.beans.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @ClassName SkuServiceImpl
 * @Description TODO
 * @Author Admin
 * @Date 2021/11/27 9:16
 * @Version 1.0
 **/
@Service
public class SkuServiceImpl implements SkuService {
    @Autowired
    private SkuMapper skuMapper;
    @Override
    public List<ItemSku> pageSearch(Integer startRow, Integer limit,Integer id) {
        return skuMapper.pageSearch(startRow, limit,id);
    }

    @Override
    public Integer getCount(Integer id) {
        return skuMapper.getCount(id);
    }

    @Override
    @Transient
    public Integer insert(String title, String descrip, Integer spuId, BigDecimal price, String param,Integer inventory, Integer enable, Date creatTime, Date lastTime) {
        return skuMapper.insert(title, descrip, spuId, price, param,inventory, enable, creatTime, lastTime);
    }

    @Override
    @Transient
    public Integer update(Integer id, String title, String descrip, Integer spuId, BigDecimal price, String param,Integer inventory, Integer enable, Date creatTime, Date lastTime) {
        return skuMapper.update(id,title, descrip, spuId, price, param,inventory, enable, creatTime, lastTime);
    }

    @Override
    @Transient
    public Integer delete(Integer id) {
        return skuMapper.delete(id);
    }
}
